1. Field of the Invention
The present invention relates to image compression methods, and in particular relates to intra-prediction mode optimization methods adopted in image compression.
2. Description of the Related Art
During the encoding/decoding procedure, the relevance between successive images is taken into consideration (e.g. motion estimation compensation) while the space relevance of pixels of one single image is taken into consideration (e.g. intra prediction encoding) as well.
This specification, is focused on intra-prediction encoding techniques.
FIG. 1 illustrates a block diagram depicting the concept of intra-prediction encoding. When the encoder receives an image 102 (of original data), it delivers the image 102 to an intra-prediction encoding module 104 to generate an intra-prediction image 106. A subtractor 108 outputs a residual image 110 based on the difference between the image 102 and the intra-prediction image 106. The residual image 110 is compressed by a data compression module 112 and thereby compressed data 114 is generated.
In the H.264 standard, various intra-prediction mode candidates are provided. From the intra-prediction mode candidates, the intra-prediction encoding module 104 selects the suitable intra-prediction mode for each block of the image 102, and encodes every block, accordingly. For intra-prediction encoding, it is expected that the intra-prediction image 106 will be similar to the image 102, such that the content of the residual image 110 is simple and no complex features are contained therein. Thus, the quantity of the compressed data 114 is considerably reduced.
H.264 is a highly-compressed digital video encoding/decoding standard. FIG. 2 shows a kind of method an image is intra-prediction encoded. One image 200 is divided into a plurality of Macroblcks, with a size of 16×16 pixels. During the intra-prediction encoding procedure, the Macroblocks in the first row are encoded from left to right. After the Macroblocks of the first row are all encoded, Macroblocks of the next row are encoded from left to right. The rows of Macroblocks are intra-prediction encoded one by one until the intra-prediction encoding of the entire image is finished. The currently encoded Macroblock may be regarded as a target Macroblock. The encoding of the target Macroblock is generally based on the encoding result of reference Macroblocks which are adjacent to the target block and have been encoded. In FIG. 2, the Macroblock MBi,j is regarded as the target Macroblock, and the oblique region includes Macroblocks that have been encoded. Macroblocks MBi,j−1, MBi−1,j−1, MBi−1 j, MBi−1 j+1, which are adjacent to the target Macroblock MBi,j and have been encoded, are regarded as the reference Macroblocks. The encoding of the target Macroblock MBi,j is based on the encoding result of the reference Macroblocks MBi,j−1, MBi−1 j−1, MBi−1 j, MBi−1 j+1.
For the intra-prediction encoding procedure, the encoding size is not limited to 16×16 pixels (the size of one Macroblocks). Instead, one Macroblock may be further divided into blocks of smaller sizes and each block requires one separate intra-prediction encoding procedure. For different encoding sizes, the H.264 standard provides different options to determine the intra-prediction mode. For example, when the encoding size is one Macroblock (16×16 pixels), four candidates are provided for determining the intra-prediction mode. When one Macroblock is further divided into four blocks each includes 8×8 pixels, wherein 9 intra-prediction mode candidates are provided for each 8×8 block. For another case wherein one Macroblock is divided into 16 blocks, each includes 4×4 pixels, wherein another 9 intra-prediction mode candidates are provided for every 4×4 block.
FIG. 3 shows the 9 intra-prediction mode candidates for one 8×8 block. As shown, the target block contains 8×8 pixels. The intra-prediction encoding result of reference blocks adjacent to the target block are taken into consideration in different directions when different intra-prediction modes, Mode 0, Mode 1 and Mode 3 . . . Mode 8, are adopted in the intra-prediction encoding procedure of the target block. In Mode 2, an average calculation is performed on the intra-prediction encoding result of the adjacent pixels, and the calculated average is applied in the intra-prediction encoding of the target block. As for the blocks of other size (16×16 pixels or 4×4 pixels), several intra-prediction mode candidates have been introduced in the H.264 standard, but they are not further discussed here.
One image can be divided into a plurality of Macroblocks, each containing 16×16 pixels, wherein each Macroblock may be further divided into a plurality of blocks each containing 8×8 pixels or 4×4 pixels, and each intra-prediction encoding size refers to a set of candidates for determining the intra-prediction mode therein. Therefore, it usually takes a long period of time to obtain the best intra-prediction encoding proposal for one image (for example, to obtain the most suitable intra-prediction size to divide the image and to obtain the most suitable intra-prediction mode for each divided block). It is an important issue to obtain the best intra-prediction encoding proposal in a short period of time.